// 选中后，将数据放入到一个变量中
mini.parse();
var projectName = $("#projectName").val();
var grid = mini.get("shopGrid");
var cloneData={};//传递过来的值

/** 确认选中*/
function onOkShop(){
	var action ={};
	action.status = 1;
	action.rows = grid.getSelecteds();
	window.CloseOwnerWindow(action);
}

/**
 * 查询
 */
function seachRow(){
 var form = new mini.Form("#formseach");
   var data = form.getData(true, false);
	data.isDel = 0;// 默认查询未删除的店铺
	grid.url = projectName+"/ShShopAdmin/List";
	grid.load(data,function(){
		var rows = grid.findRows(function (row) {
			 var flag = false;
			 if(row.shopNumId == cloneData.shopNumId){
				flag = true;
			 }
			 return flag;
	   });
		grid.selects(rows);
	});
}

////////////////////
//标准方法接口定义
function CheckEventShop(data) {
//跨页面传递的数据对象，克隆后才可以安全使用
	data = mini.clone(data);
	setData(data);
}

/**
 * 设置表格数据
 */
function setData(data){
	cloneData = data;
	var form = new mini.Form("#formseach");
	form.setData(cloneData);
	seachRow();
}


function setDataArr(data){
	cloneDataArr = mini.clone(data);
	searchRowArr();
}

function searchRowArr(){
	var form = new mini.Form("#formseach");
    var data = form.getData(true, false);
	data.isDel = 0;// 默认查询未删除的店铺
	grid.url = projectName+"/ShShopAdmin/List";
	grid.load(data,function(){
		var rows = grid.findRows(function (row) {
			 var flag = false;
			for(var i=0; i<cloneDataArr.length; i++){
				if(cloneDataArr[i].shopNumId == row.shopNumId){
					flag = true;
				}
			}
			 return flag;
	   });
		grid.selects(rows);
	});
}

